// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.utils.staterestapi.errors;

public abstract class StateRestApiException extends Exception {

    private Integer htmlCode;
    private String htmlStatus;

    public StateRestApiException(String description) {
        super(description);
    }

    /**
     * If given, this HTML code is set in the response. If not given, a value will
     * be autogenerated to fit.
     */
    public StateRestApiException setHtmlCode(int code) {
        htmlCode = code;
        return this;
    }

    /**
     * If given, this HTML status string is set in the response. If not given, a value will
     * be autogenerated to fit.
     */
    public StateRestApiException setHtmlStatus(String status) {
        htmlStatus = status;
        return this;
    }

    public Integer getCode() { return htmlCode; }
    public String getStatus() { return htmlStatus; }

}
